package com.etoak.api;

import com.etoak.common.core.vo.ResultVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
 * @author zhaochenhao
 * @Description
 * 声明远程接口
 * 1:@PostMapping 必须提供 consumes 属性,它的值必须是 Multipart/form-data
 * 2:MultipartFile参数钱必须增加 @RequestPart
 * @since 2024/8/13 9:45
 */
@FeignClient("upload-service")
public interface UploadService {

    /* 声明远程服务接口 */
    @PostMapping(value = "/upload/image",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    ResultVo<String> upload(@RequestPart MultipartFile image) throws IOException;
}
